package cn.yuanqiao.archive.danganzhengli.domain;

import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author zjj
 * @date 2023/7/17
 */
public class HandOverDa extends BaseEntity {

    private final String BIGTABLENAME = "_HAND_OVER_DA";

    public HandOverDa() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            tenantCode = SecurityUtils.getLoginUser().getUser().getTenantCode();
            if (StringUtils.isEmpty(tenantCode)){
                throw new ServiceException("TenantCode is null");
            }
        }
        this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
    }

    private String tableName;

    @IdAnnotation
    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long id;

    /** 档案id */
    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long daId;

    /*档案类型 0=组件 1=组卷 3=项目*/
    private Integer daType;

    /*创建人ID*/
    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long createId;

    /*状态 0=待移交 1=移交中 2=已移交 99=已取消*/
    private Integer state;

    /*移交单ID*/
    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long handOverId;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getDaId() {
        return daId;
    }

    public void setDaId(Long daId) {
        this.daId = daId;
    }

    public Integer getDaType() {
        return daType;
    }

    public void setDaType(Integer daType) {
        this.daType = daType;
    }

    public Long getCreateId() {
        return createId;
    }

    public void setCreateId(Long createId) {
        this.createId = createId;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Long getHandOverId() {
        return handOverId;
    }

    public void setHandOverId(Long handOverId) {
        this.handOverId = handOverId;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }
}
